'use strict';
new Component({
  options: {
    addGlobalClass: true,
  },
  externalClasses: ['lee-class'],
  relations: {
    '../row/main': {
      type: 'parent',
      linked(target) {
        this._updateGutter(target);
      },
      linkChanged(target) {
        this._updateGutter(target);
      },
      unliked(target) {
        this._updateGutter(target);
      },
    },
  },

  properties: {
    span: {
      type: Number,
      value: 1,
    },
  },

  data: {
    all: 1,
    gutter: 0,
  },

  methods: {
    _updateGutter(node) {
      const gutter = node.data.gutter / 2;
      if (gutter > 0) this.setData({ gutter });
    },
  },
});
